function timeStamp2String(time){
    if (undefined == time){
        return "";
    }
    var datetime = new Date();
    datetime.setTime(time);
    var year = datetime.getFullYear();
    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
    var hour = datetime.getHours()< 10 ? "0" + datetime.getHours() : datetime.getHours();
    var minute = datetime.getMinutes()< 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
    var second = datetime.getSeconds()< 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
    return year + "-" + month + "-" + date+" "+hour+":"+minute+":"+second;
}

function getDiffOfNow(time) {
    if (undefined == time) {
        return 0;
    }
    var datetime = new Date();
    datetime.setTime(time);
    var year = datetime.getFullYear();
    var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
    var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();

    var curDate = new Date();
    var year1 = curDate.getFullYear();
    var month1 = curDate.getMonth() + 1 < 10 ? "0" + (curDate.getMonth() + 1) : curDate.getMonth() + 1;
    var date1 = curDate.getDate() < 10 ? "0" + curDate.getDate() : curDate.getDate();

    var shortDate = new Date(year + "-" + month + "-" + date).getTime();
    var curShortDate = new Date(year1 + "-" + month1 + "-" + date1).getTime();

    var diff = parseInt((shortDate - curShortDate) / 1000 / 60 / 60 / 24);
    return diff;
}